<?php
class Math
{
	/**
	 * 浮点数比较大小
	 * 
	 * @param float|int $f1      数值1
	 * @param float|int $f2      数值2
	 * @param int $precision 小数点位数
	 * @return boolean
	 */
	public static function floatcmp($f1, $f2, $precision = 10)
	{
		$e = pow ( 10, $precision );
		return (intval ( $f1 * $e ) == intval ( $f2 * $e ));
	}
}